using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using WPCoco.Graphics;

namespace WPCoco
{
    /// <summary>
    /// Simple color layer
    /// </summary>
    public class ColorLayer : AffineNode, IColored
    {
        public ColorLayer(Color color)
        {
            Color = color;
            Width = Screen.Width; Height = Screen.Height;
            Anchor = Vector2.Zero;
        }

        public ColorLayer()
            : this(Color.CornflowerBlue)
        {

        }

        #region IColored

        Color color = Color.CornflowerBlue;

        public Color Color
        {
            get { return color; }
            set { color = value; }
        }

        #endregion

        public override void SelfDraw(GameTime gameTime)
        {
            GraphicPrimitives.WorldMatrix = WorldMatrix.Shared.CurrentMatrix;
            GraphicPrimitives.FillRectangle(Vector2.Zero, new Vector2(Width, Height), color);
        }

    }
}
